package deibay.datamodel;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;

public class Category implements Serializable{

	private String tag = null;
	private Category parent = null;
	private List<Category> childs = null;	
	
	public Category(Category parent, String tag)
	{
		this.tag = tag;
		this.parent = parent;
		this.childs = new ArrayList<Category>();
	}

	public String tag() {
		return tag;
	}	
	
	public Category parent()
	{
		return this.parent;
	}
	
	public void addChild(Category cat)
	{
		this.childs.add(cat);
	}
	
	public List<Category> childs()
	{
		return childs;		
	}
	
	public boolean equals(Object obj)
	{
		if(obj.toString().equals(this.toString()))
			return true;
		else return false;
	}
	
	public String toString()
	{
		return this.tag;
	}
}
